import React from 'react'
// 引入Route组件
import { Route, Link, Switch, Redirect, NavLink } from 'react-router-dom'
import Home from './pages/Home'
import Detail from './pages/Detail'
export default function App() {
  return (
    <div>
      <NavLink to="/home" activeClassName="xxx">
        首页
      </NavLink>
      <NavLink to="/detail" activeClassName="xxx">
        详情页
      </NavLink>

      <Switch>
        <Redirect from="/xxx" to="/home"></Redirect>
        <Route path="/home" component={Home}></Route>
        <Route path="/detail" component={Detail}></Route>
      </Switch>
    </div>
  )
}
